import axios from "axios"

export interface RailwayNetworkTopology {
    track_shapes: {
        name: string, shapes:{
            semaphore_up_position: number[],
            semaphore_down_position: number[],
            shapes:{
            end_pos: number[],
            start_pos: number[],
            type: string
        }[]}
    }[],
}

export const getTopology = async (): Promise<RailwayNetworkTopology> => {
    return (await axios.get("/api/topology")).data as RailwayNetworkTopology

}